package com.example.douyin.db;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Update;

import java.util.List;

/***
 * 对数据库中的表进行相关一系列操作
 */

@Dao
public interface UserDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void insertUser(UserInfo userInfo);
    @Update
    void updateUser(UserInfo info);
    @Delete
    void deleteUser(UserInfo userInfo);
    @Query("select * from user_info where name=:username")
    List<UserInfo> queryUser(String username);
}
